import type {Component} from "vue"
import {h} from "vue";
import {NIcon} from "naive-ui";

export function renderIcon(icon: Component) {
    return () => h(NIcon, null, {default: () => h(icon)})
}

export async function asyncRenderIcon(icon: string) {
    const {[icon]: iconComp}: any = await import("@vicons/ionicons5");
    return () => h(NIcon, null, {default: () => h(iconComp)});
    // return () => renderIcon([icon]);
}